<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>

    var arr = [1,2,3,4];
    /*for (var i=0;i<arr.length;i++) {
        console.log(i);
    }*/
    /*for (let i in arr) {
        console.log(i);
    }*/
    
    for (let i of arr) {
        console.log(i);
    }
    
    

</script>

</body>
</html>